package com.sky.task;

import com.sky.service.OrderTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
@Slf4j
public class MyTask {
    @Autowired
    private OrderTaskService orderTaskService;
//@Scheduled(cron = "0/5 * * * * ?")
public void executeTask(){


}

@Scheduled(cron = "0 0/1 * * * ? ")
    public void orderstatus(){
    LocalDateTime now = LocalDateTime.now();
    log.info("定时任务开始: {}", LocalDateTime.now());


    orderTaskService.orderstatus();
}
@Scheduled(cron = "0 0 1 * * ? ")
public void  orderStatusComplete(){
    orderTaskService.orderStatusComplete();
}
}
